package com.t2t.top.devops.constant;

public enum BugLevel {

    blocker(6, "致命"),
    critical(5, " 严重"),
    major(4, "重要"),
    normal(3, "一般"),
    minor(2, "轻微"),
    suggestion(1, "建议");

    public final Integer TYPE;
    public final String DESC;

    private BugLevel(Integer type, String desc) {
        TYPE = type;
        DESC = desc;
    }

    public static BugLevel convert(Integer type) {
        if (type == null) {
            return null;
        }
        BugLevel[] types = BugLevel.values();
        for (BugLevel bugLevel : types) {
            if (type.equals(bugLevel.TYPE)) {
                return bugLevel;
            }
        }
        return null;
    }
}